<?php

 
class dev_desktop_docs implements desktop_interface_widget{
    
    var $order = 1;
    function __construct($app){
        $this->app = $app; 
        $desktop = app::get('desktop');
        $this->render =  new base_render($desktop);
    }
    
    function get_title(){
        return app::get('dev')->_("开发文档");    
    }
    
    function get_html(){ 
        $html = '';
        $rows = app::get('base')->model('apps')->getlist('*',array('installed'=>true));
        $doclib = array();
        $baseurl = kernel::base_url();
        foreach($rows as $k=>$v){
            $docs = app::get($v['app_id'])->docs();
            
            if($docs){
                $html.="<div class=\"clearfix dashbd-row\"><h4>{$v['app_name']}</h4>";
                $html.='<ul>';
                foreach($docs as $docname=>$doctitle){
                    $html .= "<li class=\"figure-zero\"><a target=\"_blank\" href=\"$baseurl/index.php/app-doc/{$v['app_id']}/{$docname}\">{$doctitle}</a></li>";
                }
                $html.='</ul>';
                $html.='</div>';
            }
        }
        return $html;
    }
    
    function get_className(){
        return "develop-docs";
    }
    
    function get_width(){
        return "l-1";
    }
    
}

?>
